//
//  DWDFowardCell.swift
//  dwdWb
//
//  Created by Dengdwd on 15/10/16.
//  Copyright © 2015年 dwd. All rights reserved.
//

import UIKit

class DWDFowardCell: DWDStatusCell {

    override var statusModel:DWDStatusModel? {
        didSet{
            fowardLabel.text = statusModel?.forwardText
        }
    }
    
    override func setUpUI() {
        super.setUpUI()
        contentView.insertSubview(fowardBtn, belowSubview: picView)
        contentView.insertSubview(fowardLabel, aboveSubview: fowardBtn)
        fowardBtn.ff_AlignVertical(type: ff_AlignType.BottomLeft, referView: contentLabel, size: nil, offset: CGPoint(x: -DWDStatusMargin, y: DWDStatusMargin))
        fowardBtn.ff_AlignVertical(type: ff_AlignType.TopRight, referView: bottomView, size: nil, offset: CGPoint(x: 0, y: DWDStatusMargin))
        fowardLabel.ff_AlignInner(type: ff_AlignType.TopLeft, referView: fowardBtn, size: nil, offset: CGPoint(x: DWDStatusMargin, y: DWDStatusMargin))
        let cons = picView.ff_AlignVertical(type: ff_AlignType.BottomLeft, referView: fowardLabel, size: CGSize(width: DWDPicViewMaxWidth, height: DWDPicViewMaxWidth), offset: CGPoint(x: 0, y: DWDStatusMargin))
        //      拿到数组后重新给数组里的属性赋值
        picViewWidthCons = picView.ff_Constraint(cons, attribute: NSLayoutAttribute.Width)
        picViewHeightCons = picView.ff_Constraint(cons, attribute: NSLayoutAttribute.Height)
        picViewTopCons = picView.ff_Constraint(cons, attribute: NSLayoutAttribute.Top)

    }
    
    
    
    
    private lazy var fowardBtn : UIButton = {
        let btn = UIButton()
        btn.backgroundColor = UIColor(white: 0.9, alpha: 0.2)
        return btn
        }()
    private lazy var fowardLabel: UILabel = UILabel(title: "hehehehhehehehhehehehehehheheheh", color: UIColor.darkGrayColor(), fontSize: 15,layoutWidth:SCREENW - 2 * DWDStatusMargin)
}
